<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6.css"/>
<![endif]-->
<link rel="stylesheet" type="text/css"  href="../../../../public/layui/css/layui.css">
<link href="../../../../public/admin/css/style_v2.0.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/style_v2.0.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
</head>
<body>
<div class="position mt10">当前位置：<a href="{:U('Index/main')}">后台首页</a> > <a href="{:U('Web/domain')}">网站列表</a>  >  搜索结果</div>
<div id="container">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>
     <empty name="sotype">
      搜索结果&nbsp;<font style="font-size:13px; color:#666666;">(共<font color="#FF0000">{$count}</font>个)</font>
     </empty>
     <notempty>
         <if condition="$sotype eq 1">急需续费网站&nbsp;<font style="font-size:13px; color:#666666;">(共<font color="#FF0000">{$count}</font>个)</font>
         <elseif condition="$sotype eq 2" />已过期网站&nbsp;<font style="font-size:13px; color:#666666;">(共<font color="#FF0000">{$count}</font>个)</font>
         <elseif condition="$sotype eq 3" />急需续费服务器&nbsp;<font style="font-size:13px; color:#666666;">(共<font color="#FF0000">{$count}</font>个)</font>
         </if>
         
     </notempty>
 </legend>
</fieldset>
<div class="layui-form" >
   <div class="layui-btn-group">
     <a href="{:U('Admin/Web/domain/')}" class="layui-btn layui-btn-big"><i class="layui-icon">&#xe60a;</i> 全部域名</a>
     <a href="{:U('Admin/Web/search',array('sotype'=>'1'))}" class="layui-btn layui-btn-big layui-btn-danger"><i class="layui-icon">&#xe60e;</i> 急需续费域名</a>
     <a href="{:U('Admin/Web/search',array('sotype'=>'3'))}" class="layui-btn layui-btn-big layui-btn-warm"><i class="layui-icon">&#xe637;</i> 到期服务器</a>
    <a href="{:U('Admin/Web/search',array('sotype'=>'2'))}" class="layui-btn layui-btn-big  layui-btn-primary"><i class="layui-icon">&#x1006;</i> 已过期域名</a>
  </div>
   <div class="layui-btn-group" style="float:right;">
      <button   data-method="notice" class="layui-btn layui-btn-big" ><i class="layui-icon">&#xe654;</i>  添加新域名</button>
      <a href="{:U('web/export_domain/')}"  class="layui-btn layui-btn-big layui-btn-normal"><i class="layui-icon">&#xe62d;</i> 导出报表</a>
</div>
<div class="hselect mt10" style="background-color:#FFFFFF;">
    <form name='search' action="{:U('Admin/Web/search')}" enctype="multipart/form-data" method="get"  class="layui-form">
    <span>高级搜索：</span>
    <div id="keyword"><input name="keyword" type="text" id="keyword"  value="" placeholder="请输入关键词" autocomplete="off" class="layui-input"></div>
    
    <div class="hselect_box" style="width:120px;">
     <select name="group" lay-verify="" lay-filter="">
          <option value="">选择所在分组</option>
          <volist name="group" id="g">
          <option value="{$g.gid}" <if condition="I('get.group') eq $g['gid']">selected</if>>{$g.groupname}</option>
          </volist>
        </select>
    </div>
    <div class="hselect_box" style="width:120px;">
     <select name="account" lay-verify="">
           <option value="">域名所属账号</option>
           <volist name="account" id="a">
           <option value="{$a.aid}" <if condition="I('get.account') eq $a['aid']">selected</if>>{$a.aname}</option>
           </volist>
           <option value="0">域名不在我处</option>
        </select>
    </div>
    <span>到期时间:</span>
    <div class="hselect_box" style="width:120px;">
         <input name="ddstart" type="text" value=""  placeholder="开始日" class="layui-input ico-date" id="ddstart">
    </div>
    <span style="padding-right:10px">-</span>
    <div class="hselect_box" style="width:120px;">
    <input name="ddend" type="text"  value=""  placeholder="结束日" class="layui-input ico-date"  id="ddend">
    </div>
    <div class="hselect_box"><button class="layui-btn layui-btn-primary" style=" margin-top:-4px;" lay-submit lay-filter="formSearch" id="search">立即提交</button></div>
    </form>
    <div class="c"></div>
</div>
</div>
<!--高级搜索-->
<div class="c"></div>
<div class="layui-form" >
<table class="layui-table" id="table">
    <thead>
    <tr style="text-align:center;">
      <th tyle="text-align:center;">&nbsp;</th>
      <th>ID</th>
      <th>域名</th>
      <th>网站名称</th>
      <th>分组</th>
      <th>状态</th>
      <th>启用</th>
      <th>到期时间</th>
      <th>服务器</th>
      <th>账号</th>
      <th>联系人</th>
      <th colspan="2" align="center">操作</th>
    </tr> 
    </thead>
    <form id="form2" name="form2" method="post" action="{:U('Admin/Web/domain_del/')}">  
     <volist name="list" id="r">
    <tr>
      <td  align="center" class="layui-form-item"><input type="checkbox" title="" id="did[]"  lay-skin="primary"  name="did[]" value="{$r.did}" /></td>
      <td align="center"  style="white-space:nowrap;">{$r.did}</td>
      <td align="center" height="22px">{$r.weburl}</td>
      <td align="center" height="22px">{$r.webname}</td>
      <td align="center" height="22px"><a href="{:U('Web/search',array('group' => $r['gid']))}">{$r.groupname}</a></td>
      <td><if condition="$r['status'] eq 0"><font color="red">已过期</font><else /><font color="009688">正常</font></if></td>
      <td><if condition="$r['work'] eq 0"><font color="red">未启用</font><else /><font color="009688">启用</font></if></td>
      <td id="endtime">{$r.endtime|date="Y-m-d",###}</td>
      <td>{$hosttype[$r['hosttype']]}<span id="hosttime" style="display:none;">{$r.hostend|date="Y-m-d",###}</span></td>
      <td>{$r.aname}</td>
      <td>{$r.linkman}</td>
      <td align="center">
         <div class="layui-btn-group" style="width:125px;">
          <a href="{:U('Admin/Web/webfast_update/',array('did' => $r['did']))}" title="续费更新" class="layui-btn layui-btn-small">续费</a><a href="{:U('Admin/Web/domain_edit/',array('did' => $r['did']))}" title="编辑" class="layui-btn layui-btn-small"><i class="layui-icon">&#xe642;</i></a><a href="{:U('Admin/Web/domain_del',array('did' => $r['did']))}" class="layui-btn layui-btn-small layui-btn-danger" title="删除" onClick="return checkConfirm('您确认删除记录?')"><i class="layui-icon">&#xe640;</i></a>          </div>      </td>
    </tr>
    </volist>
    <tr>
      <td align="center"><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></td>
      <td colspan="10">
      <div style="padding-left:20px;">  
         <input type="button" value="全选" name="selectall" class="layui-btn" />
         <input type="button" value="反选" name="selectno" class="layui-btn "/>
         <button  name="btnDel" lay-submit="" lay-filter="btnDel" class="layui-btn layui-btn-danger" />删除</button>
      </div>      </td>
      <td align="center">&nbsp;</td>
    </tr>
   </form>
    </table>
  </div>
    <div class="c"></div>
    <div id="pages">{$page}</div>      

</div>
</body>
</html>
<form name=reg action="{:U('Admin/Web/domain_update')}"  enctype="multipart/form-data"  method="post"  class="layui-form" id="domain_add" style="display:none">
<div class="layui-form" style="background-color:#FFFFFF;">
    <table class="layui-table">
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>网站域名：</td>
	  <td width="80%"><input name="weburl" type="text" id="weburl" value="" required  lay-verify="weburl" placeholder="网站域名" autocomplete="off" class="layui-input" style="width:400px; float:left">    
      <span class="table_txt" style="color:#999999">添加多个域名请用英文逗号(,)隔开</span>      </td>
    </tr>
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>网站名称：</td>
	  <td width="80%"><input name="webname" type="text" id="webname" value="" required  lay-verify="webname" placeholder="网站名称" autocomplete="off" class="layui-input" style="width:400px; float:left"> </td>
    </tr>
    <tr>
      <td align="right">所属分组：</td>
      <td> <span class="table_span" style="width:150px; padding-left:0px;"><select name="gid" lay-verify="" lay-filter="gid">
           <option value="1">默认分组</option>
           <volist name="group" id="g">
           <option value="{$g.gid}">{$g.groupname}</option>
           </volist>
        </select>
      </span></td>
    </tr>
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>域名时间：</td>
	  <td width="80%">
      <input name="dstart" type="text" id="dstart" value=""  placeholder="开始日"  class="layui-input ico-date"  style="width:150px; float:left;">
      <span class="table_span">~</span>
      <input name="dend" type="text" id="dend" value=""  placeholder="结束日" class="layui-input ico-date"  style="width:150px; float:left;">      </td>
    </tr>
    <tr>
	  <td align="right">域名管理权：</td>
	  <td><input type="radio" name="isowner" value="1"  lay-filter="isowner" title="在我处" checked > &nbsp;&nbsp;&nbsp; <input type="radio" name="isowner" value="0" title="不在我处"   lay-filter="isowner"></td>
	</tr>
    <tr id="webaccount">
	  <td align="right">域名所在账号：</td>
	  <td>
      <span class="table_span" style="width:150px; padding-left:0px;"><select name="webaccount" lay-verify="" lay-filter="">
           <option value="">请选择账号</option>
           <volist name="account" id="a">
           <option value="{$a.aid}">{$a.aname}</option>
           </volist>
        </select>
      </span>      </td>
	</tr>
    <tr id="quanxian">
	  <td align="right">域名管理信息：</td>
	  <td>
          <div class="fee_box"><span class="table_txt">域名管理入口：</span><span style="width:400px; float:left;"><input name="dinfo[0]" type="text" id="dinfo" value=""  autocomplete="off" class="layui-input" placeholder="http://" ></span></div>
          <div class="fee_box"><span class="table_txt">域名管理账号：</span><span style="width:400px; float:left;"><input name="dinfo[1]" type="text" id="dinfo" value=""  autocomplete="off" class="layui-input" placeholder="" ></span></div>
          <div class="fee_box"><span class="table_txt">域名管理密码：</span><span style="width:400px; float:left;"><input name="dinfo[1]" type="text" id="dinfo" value=""  autocomplete="off" class="layui-input" placeholder="" ></span></div>      </td>
	</tr>
    <tr>
	  <td align="right">域名状态：</td>
	  <td><input type="radio" name="status" value="1" title="正常" checked > &nbsp;&nbsp;&nbsp; <input type="radio" name="status" value="0" title="过期" > </td>
	</tr>
    <tr>
	  <td align="right">是否可以访问：</td>
	  <td><input type="radio" name="work" value="1" title="可以" checked > &nbsp;&nbsp;&nbsp; <input type="radio" name="work" value="0" title="无法访问" > </td>
	</tr>
    <tr>
	  <td align="right">网站源码：</td>
	  <td><input name="codetype" type="text" id="codetype" value="" autocomplete="off" placeholder="网站源码类型" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">网站到期日：</td>
	  <td><input name="endtime" type="text" id="endtime2" value=""  placeholder="到期日" class="layui-input ico-date"  style="width:150px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">网站截图：</td>
	  <td><input type='file'  name='photo' multiple></td>
	  </tr>
	<tr>
    <tr>
	  <td align="right">续费价格：</td>
	  <td><input name="price" type="text" id="price" value="" autocomplete="off" placeholder="￥" lay-verify="price" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    </table>
    </div>
    <div class="layui-form" style="background-color:#FFFFFF;">
    <blockquote class="layui-elem-quote">服务器信息</blockquote>
    <table class="layui-table">
	<tr>
	  <td width="20%" align="right">服务器类型：</td>
	  <td>
      <span class="table_span" style="width:150px; padding-left:0px;">
        <select name="hosttype" lay-verify="" lay-filter="">
             <option value="">请选择服务器类型</option>
             <option value="0">独立服务器</option>
             <option value="1">虚拟主机</option>
             <option value="2">云虚拟主机</option>
        </select>
      </span>
      </td>
	</tr>
    <tr>
	  <td align="right">服务器ip：</td>
	  <td><input name="hostip" type="text" id="hostip" value="" autocomplete="off" placeholder="IP" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">所在账号：</td>
	  <td>
       <span class="table_span" style="width:150px; padding-left:0px;"><select name="hostaccount" lay-verify="" lay-filter="">
           <option value="">请选择账号</option>
           <volist name="account" id="a">
           <option value="{$a.aid}">{$a.aname}</option>
           </volist>
        </select>
      </span>
      </td>
	</tr>
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>服务器时间：</td>
	  <td width="80%">
      <input name="hoststart" type="text" id="hoststart" value=""  placeholder="开始日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:150px; float:left;">
      <span class="table_span">~</span>
      <input name="hostend" type="text" id="hostend" value=""  placeholder="结束日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:150px; float:left;">
      </td>
    </tr>
     <tr>
	  <td align="right">是否备案：</td>
	  <td><input type="radio" name="isbeian" value="1"  lay-filter="isbeian" title="已备案" checked > &nbsp;&nbsp;&nbsp; <input type="radio" name="isbeian" value="0" title="未备案"  lay-filter="isbeian"> </td>
	</tr>
    <tr id="beian_tr">
	  <td align="right">备案信息：</td>
	  <td>
         <span class="table_span" style="width:400px; padding-left:0px;">
             <input name="beian" type="text" id="beian" value="" autocomplete="off" placeholder="备案号" class="layui-input">
         </span>
        <span class="table_txt">（选择分组时会自动填写备案号）</span>
      </td>
	</tr>
    <tr>
	  <td align="right">FTP信息：</td>
	  <td>
          <div class="fee_box"><span class="table_txt">FTP地址：</span><span style="width:400px; float:left;"><input name="ftp[0]" type="text" id="ftp" value=""  autocomplete="off" class="layui-input" placeholder="" ></span></div>
          <div class="fee_box"><span class="table_txt">FTP账号：</span><span style="width:400px; float:left;"><input name="ftp[1]" type="text" id="ftp" value=""  autocomplete="off" class="layui-input" placeholder="" ></span></div>
          <div class="fee_box"><span class="table_txt">FTP密码：</span><span style="width:400px; float:left;"><input name="ftp[2]" type="text" id="ftp" value=""  autocomplete="off" class="layui-input" placeholder="" ></span></div>
      </td>
	</tr>
    </table>
    </div>
    <div class="layui-form" style="background-color:#FFFFFF;">
    <blockquote class="layui-elem-quote">联系人信息</blockquote>
    <table class="layui-table">
    <tr>
	  <td width="20%" align="right">联系人：</td>
	  <td>
      <span class="table_span" style="width:150px; padding-left:0px;">
      <input name="linkman" type="text" id="linkman" value="" autocomplete="off" placeholder="联系人" class="layui-input" ></span>
      <span class="table_txt">&nbsp;&nbsp;&nbsp;快速选择客户:</span>
      <span class="table_span" style="width:150px; padding-left:0px;">
          <select name="fastselect" lay-verify="" lay-filter="fastselect">
          <option value="">请选择客户</option>
           <volist name="customer" id="c">
           <option value="{$c.cid}">{$c.cuname}</option>
           </volist>
        </select>
      </span>
      <span class="table_txt" style="color:#FF0000;">快速选择会清空你之前填写的联系方式，请谨慎</span>
      </td>
	</tr>
	<tr>
	  <td align="right">电话：</td>
	  <td><input name="phone" type="text" id="phone" value="" autocomplete="off" placeholder="电话" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">微信：</td>
	  <td><input name="wechat" type="text" id="wechat" value="" autocomplete="off" placeholder="微信" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">Q Q：</td>
	  <td><input name="qq" type="text" id="qq" value="" autocomplete="off" placeholder="QQ" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
    <tr>
	  <td align="right">渠道姓名：</td>
	  <td><input name="qudao" type="text" id="qudao" value="直属客户" autocomplete="off" class="layui-input" style="width:200px; float:left;"></td>
	</tr>
	<tr>
	  <td align="right">其他信息：</td>
	  <td><textarea name="content" id="content" placeholder="请输入内容" class="layui-textarea"></textarea></td>
	  </tr>
	   <tr>
	     <td align="right">排序：</td>
	     <td><span class="table_txt"><input type="text" name="listorder" value="0" class="layui-input" style="width:50px;"></span>
            <span class="table_txt"><font color="#666666">（越大越靠前）</font></span></td>
        </tr>
	   <td align="right"><font color=red size="1">·</font>添加时间：</td>
	  <td><input name="inputtime" type="text" id="inputtime" value="{$now|date='Y-m-d H:i:s',###}"  autocomplete="off" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="layui-input ico-date"  style="width:250px; float:left;"></td>
	  </tr>
      <tr> 
	  <td colspan=3 align="center" valign="middle">
		<input type="submit" name="Submit" lay-filter="domainadd" value="确&nbsp; &nbsp;定" class="layui-btn" >
		<input type="reset" name="Submit2" value="重　置" class="layui-btn layui-btn-primary" >		 </td>
	</tr>
    </table>
    </div>
 </form>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script>
layui.use(['form','laydate'], function(){
  var form = layui.form
  ,laydate = layui.laydate;
  
   var active = {
       notice: function(){
		  layer.open({
			type: 1
			,title: '新增网站' //不显示标题栏
			,closeBtn: 2
			,area: ['700px','600px']
			,shade: 0.4
			,id: 'LAY_layuipro' //设定一个id，防止重复弹出
			//,btn: ['提交', '关闭']
			,btnAlign: 'c'
			,moveType: 1 //拖拽模式，0或者1
			,content: $("#domain_add"),
            })
       }
   }
   
    $('.layui-btn-group .layui-btn').on('click', function(){
		var othis = $(this), method = othis.data('method');
		active[method] ? active[method].call(this, othis) : '';
	  });
   
   laydate.render({
    elem: '#ddstart'
	,type: 'date'
  });
  
   laydate.render({
       elem:'#ddend'
	   ,type:'date'
   });
   
   form.verify({
        price_min: [/\d*$/, '必须是数字']
	   ,price_max: function(value){
	       if(value != ""){
			   if(!new RegExp(/^\d*$/).test(value)){
		            return '必须是数字0';
		       }
			   if(value < $("#price_min").val()){
			       return '价格范围填写错误';
			   }
		   }else{
		      //layer.msg(value));
		   }
	   }
   });
   
  //监听提交
  form.on('submit(formSearch)', function(data){
    //layer.msg(JSON.stringify(data.field));
	title: '最终的提交信息'
	return true;
  });
  
  laydate.render({
    elem: '#dstart'
	,type: 'date'
  });
  
   laydate.render({
       elem:'#dend'
	   ,type:'date'
   });
   
  laydate.render({
    elem: '#hoststart'
	,type: 'date'
  });
  laydate.render({
    elem: '#endtime2'
	,type: 'date'
  });
   laydate.render({
       elem:'#hostend'
	   ,type:'date'
   });
   laydate.render({
       elem:'#inputtime'
	   ,type:'datetime'
   });
   
   $("#quanxian").css('display','none');
   form.on('radio(isowner)', function(data){
        $val = data.value;
		if($val=="" || $val =="0"){
		   $("#quanxian").css('display','');
		   $("#webaccount").css('display','none');
		}else{
		   $("#webaccount").css('display','');
		   $("#quanxian").css('display','none');
		}
   });
   
   /*获取是否备案信息*/
   form.on('radio(isbeian)', function(data){
        $val = data.value;
		if($val=="" || $val =="0"){
		   $("#beian_tr").css('display','none');
		}else{
		   $("#beian_tr").css('display','');
		}
   });
   
   /*监听分组自动填表备案信息*/
   form.on('select(gid)', function(data){
       $gid = data.value;
	   if($gid != 1){
	       $.ajax({
		       url:"{:U('Web/ajaxget_beian')}",
			   dataType:'json',
			   type:'get',
			   data:{'gid': $gid },
			   success:function(data){
			       $("input[name=beian]").val(data);
			   }
		   });
	   }
   });
   
   /*快速选择客户  自动填表*/
   form.on('select(fastselect)', function(data){
       $cid = data.value;
	   if($cid){
	       $.ajax({
		       url:"{:U('Customer/ajaxget_cus')}",
			   dataType:'json',
			   type:'get',
			   data:{'cid': $cid },
			   success:function(data){
                   data = eval('(' + data + ')');
			       if(data){
			           $("#linkman").val(data.cuname);
					   $("#phone").val(data.cphone);
					   $("#wechat").val(data.cwechat);
					   $("#qq").val(data.cqq);
					   if(data.ctype == 1){
					      $("#qudao").val("直属客户");
					   }
					   form.render();
				   }else{
				        $("input[name=beian]").val("");
				   }
			   }
		   });
	   }
   });
   
   form.verify({
        webname: function(value){
		    if(value !="" || value.length  >0){
			    
			}else{
			   return '请填写网址名称';
			}
		}
		,weburl: function(value){
		    if(value == "" || value.length ==0){
			return '请填写网站域名！';
			}
		}    
	   ,price: function(value){
	       if(value != ""){
			   if(!new RegExp(/^\d*$/).test(value)){
		            return '必须是数字0';
		       }
		   }else{
		      return '请填写价格！'
		   }
	   }
   });
   
   //监听提交
  form.on('submit(domainadd)', function(data){
    //layer.msg(JSON.stringify(data.field));
	title: '最终的提交信息'
	return true;
  });

});
$(document).keyup(function(event){ 
    if(event.keyCode ==13){  
	    $("#search").trigger("click"); 
	}
});
</script>